# Contributor: Luca Weiss <luca@z3ntu.xyz>
# Maintainer: Luca Weiss <luca@z3ntu.xyz>
pkgname=ayatana-indicator-messages
pkgver=22.2.0
pkgrel=0
pkgdesc="Ayatana Indicator Messages Applet"
url="https://github.com/AyatanaIndicators/ayatana-indicator-messages"
arch="all !s390x !riscv64" # blocked by accountsservice
license="GPL-3.0-only"
makedepends="
	accountsservice-dev
	cmake
	cmake-extras
	dbus-test-runner-dev
	glib-dev
	gtest-dev
	gtk-doc
	intltool
	vala
	"
checkdepends="dbus dbus-test-runner py3-dbus py3-dbusmock"
subpackages="$pkgname-dev $pkgname-doc $pkgname-lang"
source="https://github.com/AyatanaIndicators/ayatana-indicator-messages/archive/$pkgver/ayatana-indicator-messages-$pkgver.tar.gz"

build() {
	if [ "$CBUILD" != "$CHOST" ]; then
		CMAKE_CROSSOPTS="-DCMAKE_SYSTEM_NAME=Linux -DCMAKE_HOST_SYSTEM_NAME=Linux"
	fi
	cmake -B build \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib \
		-DBUILD_SHARED_LIBS=True \
		-DCMAKE_BUILD_TYPE=MinSizeRel \
		-DENABLE_TESTS=ON \
		$CMAKE_CROSSOPTS .
	cmake --build build
}

check() {
	cd build
	CTEST_OUTPUT_ON_FAILURE=TRUE ctest
}

package() {
	DESTDIR="$pkgdir" cmake --install build
}

sha512sums="
e81c9dd35d6f87812360f68192f9d299e8a0f5f618d319c8b259f9a094dfd78167f988e5c43b145cb03a892ad1147864d04af372c5f73582e4e95d2d790954b9  ayatana-indicator-messages-22.2.0.tar.gz
"
